package com.laicunba.ext.activity.act20170726;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationListener;

import com.laicunba.event.ActivityJoinEvent;
import com.laicunba.pojo.ActivityJoinDO;
import com.laicunba.service.CashCouponDefService;

public class Act20170726JoinListener implements ApplicationListener<ActivityJoinEvent> {
	@Autowired
	private CashCouponDefService cashCouponDefService;

	@Override
	public void onApplicationEvent(ActivityJoinEvent event) {
		ActivityJoinDO joinDO = (ActivityJoinDO) event.getSource();
		String cashCouponId = joinDO.getSubActId();
		cashCouponDefService.send2UserWithMessage(cashCouponId, joinDO.getUserId(), false, "参与国企控股活动");
		System.out.println("joinDO:" + joinDO);

	}

}
